//
//  ReturnCardViewController.m
//  GLGW_Shoping
//
//  Created by whx on 2018/12/3.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "ReturnCardViewController.h"
#import "ReturnCardViewModel.h"
#import "CircleDetailViewController.h"

@interface ReturnCardViewController ()
@property (nonatomic, strong) ReturnCardViewModel *viewModel;

@end

@implementation ReturnCardViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"我的回帖";
    if (self.circleType == CircleType_Comments) {
        self.title = @"我的评论";
    }
    self.viewModel = [[ReturnCardViewModel alloc] initWithViewToViewModel:self.groupedTableView theSuperView:self.view];
    self.viewModel.type = self.circleType;
    kWeakSelf(self);
    self.viewModel.BlockSelect = ^(NSIndexPath * _Nullable index) {
        [weakself selectDetailVC];
    };
    [self addNavigationItemWithTitles:@[@"编辑"] isLeft:NO target:self action:@selector(rightAction:) tags:@[@232] theButTitColor:kColor_Rule_Yellow titFont:SYSTEMFONT(15)];
}

- (void)rightAction:(UIButton*)sender
{
    [self.viewModel setEdit:sender];
}

- (void)selectDetailVC
{
    CircleDetailViewController *vc = [[CircleDetailViewController alloc] init];
    [self.navigationController pushViewController:vc animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
